/**
 * Created by Administrator on 2015/12/27 0027.
 */
class Time {
  private var hours = 0
  private var minutes = 0

  def get: Unit = {
    println(hours + ":" + minutes)
  }

  def this(hours: Int, minutes: Int) {
    this()
    if (hours >= 0 && hours < 23) this.hours = hours
    if (minutes >= 0 && minutes < 59) this.minutes = minutes
  }

  def `do`: Unit = {
    minutes += 1
    if (minutes == 60) {
      minutes = 0; hours += 1; if (hours == 24) hours = 0
    }
  }
}


